<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>大麦商城</title>
<link href="css/common.css" rel="stylesheet" type="text/css"/>
<link href="css/product.css" rel="stylesheet" type="text/css"/>
<script src="http://47.106.66.89:8080/js/vue.min.js"></script>
<script src="http://47.106.66.89:8080/js/axios.min.js"></script>
<link  href="http://47.106.66.89:8080/js/ele-2.15.7/theme-chalk/index.css" rel="stylesheet">
<script src="http://47.106.66.89:8080/js/ele-2.15.7/index.js"></script>
<script src="./js/category.js"></script>
<script src="./js/header.js"></script>
</head>
<body>
<div id="app">
<top ref="t"></top>
<div class="container productList">

	<category></category>
		
		<div class="span18 last">

			<div id="productForm" action="image/蔬菜 - Powered By Mango Team.htm" method="get">
				<input type="hidden" id="brandId" name="brandId" value=""/>
				<input type="hidden" id="promotionId" name="promotionId" value=""/>
				<input type="hidden" id="orderType" name="orderType" value=""/>
				<input type="hidden" id="pageNumber" name="pageNumber" value="1"/>
				<input type="hidden" id="pageSize" name="pageSize" value="20"/>

				<div id="result" class="result table clearfix">
						<ul>
							<li v-for="p in productL.records" v-if="window.location.href.split('html?')[1].includes('pageIndex=')">
								<a :href="'detail.html?'+p.id">
									<img :src="p.image" width="170" height="170"  style="display: inline-block;"/>

									<span style='color:green'>
											 {{p.pname}}
											</span>

									<span class="price">
												商城价： ￥{{p.shopPrice.toFixed(1)}}/份
											</span>

								</a>
							</li>
						</ul>
				</div>

	<div class="pagination">
		<el-pagination
				layout="prev, pager, next"
				page-size="12"
				:current-page="pageIndex"
				@current-change="changeCurrent"
				:total="productL.total">
		</el-pagination>
	</div>
			</div>
		</div>
	</div>
<div class="container footer">
	<div class="span24">
		<div class="footerAd">
					<img src="image/footer.jpg" width="950" height="52" alt="我们的优势" title="我们的优势"/>
</div>	</div>
	<div class="span24">
		<ul class="bottomNav">
					<li>
						<a >关于我们</a>
						|
					</li>
					<li>
						<a>联系我们</a>
						|
					</li>
					<li>
						<a >诚聘英才</a>
						|
					</li>
					<li>
						<a >法律声明</a>
						|
					</li>
					<li>
						<a>友情链接</a>
						|
					</li>
					<li>
						<a>支付方式</a>
						|
					</li>
					<li>
						<a >配送方式</a>
						|
					</li>
					<li>
						<a >SHOP++官网</a>
						|
					</li>
					<li>
						<a >SHOP++论坛</a>
						
					</li>
		</ul>
	</div>
	<div class="span24">
		<div class="copyright">Copyright © 2005-2013 Mango商城 版权所有</div>
	</div>
</div>
</div>

<script>
	var v = new Vue({
		el:"#app",
		data:{
			productL:{current:1,total:0,records:[]},		//分类单页商品
			pageIndex: 1,
		},
		methods:{
			//分类分页获取商品信息
			getPro(){
				this.pageIndex = 1;
				axios.get("damai-other/getPro?cid="+window.location.href.split("html?")[1]).then(res=>{
					this.productL = res.data.data;
				});
			},
			//换页
			changeCurrent(newPage){
				this.pageIndex = newPage;
				console.info(this.pageIndex);
				axios.get("damai-other/getPro?cid="+window.location.href.split("html?")[1].substring(1,0)+"&pageIndex="+this.pageIndex).then(res=>{
					this.productL = res.data.data;
				});
			}
		},
		created(){
			if(window.location.href.split("html?")[1].includes("pageIndex=")){
				this.getPro();
			}
		}
	})
</script>

</body></html>